
# def index():
#     return 123
# def foo(func):#传的内存地址
#     return func
# print(foo(index))#不用加()加()就会运行函数
# def outter(func):
#     def wrapper():
#         pass
#     return wrapper
# def outter():
#     x=111
#     def wrapper():
#         print(x)
#     return wrapper
# outter()()
def f(a):
    def f1():
        print(a)
    return f1
f=f(1)
f()
import time
def deco(func):
    def wrapper():
        startTime=time.time()
        func()
        ednTime=time.time()
        msecs=(ednTime-startTime)*1000
        print('time is %d ms'%msecs)
    return wrapper
@deco#func=deco(func) func=wrapper
def func():
    print('hello')
    time.sleep(1)
    print('world')
if __name__ == '__main__':
    # f=func
    # f()
    func()




# def psum(a,b=10):
#     return a**2+b**2
# def main():
#     a=int(input('>>>'))
#     f=psum(a)
#     print('%d'%f)
# if __name__ == '__main__':
#     main()

def fun(a):
    return sum([a[i][i] for i in range(len(a))])
def main():
    print('>>>>>>')
    a=[]
    for i in range(4):
        a.append([])
        for j in range(4):
            a[i].append(float(input('>>>>')))
    sum=fun(a)
    print(sum)
if __name__ == '__main__':
    main()